" Snippets for Lua programming language and LOVE game engine
"
" Maintainer:  Jaromir Hradilek <jhradilek@gmail.com>
" Last Change: 2008 Sep 03
" URL:         http://code.google.com/p/inlove/


" Check whether the plugin is properly loaded:
if !exists('loaded_snippet') || &cp
  finish
endif

" Create aliases:
let st = g:snip_start_tag
let et = g:snip_end_tag
let cd = g:snip_elem_delim

" Lua snippets:
exec "Snippet do do<CR>".st.et."<CR>end"
exec "Snippet for for ".st."variable".et." = ".st."from".et.", ".st."to".et." do<CR>".st.et."<CR>end"
exec "Snippet forin for ".st."variable".et." in ".st."iterator".et." do<CR>".st.et."<CR>end"
exec "Snippet function function ".st."name".et."(".st.et.")<CR>".st.et."<CR>end"
exec "Snippet ifee if ".st."expression".et." then<CR>".st.et."<CR>elseif ".st."expression".et." then<CR>".st.et."<CR>else<CR>".st.et."<CR>end"
exec "Snippet ife if ".st."expression".et." then<CR>".st.et."<CR>else<CR>".st.et."<CR>end"
exec "Snippet if if ".st."expression".et." then<CR>".st.et."<CR>end"
exec "Snippet lfunction local function ".st."name".et."(".st.et.")<CR>".st.et."<CR>end"
exec "Snippet lua #!/usr/bin/env lua<CR><CR>".st.et
exec "Snippet repeat repeat<CR>".st.et."<CR>until ".st."expression".et
exec "Snippet while while ".st."expression".et." do<CR>".st.et."<CR>end"

" LOVE specific snippets:
exec "Snippet functiond function draw()<CR>".st.et."<CR>end"
exec "Snippet functionkp function keypressed(".st."key".et.")<CR>".st.et."<CR>end"
exec "Snippet functionkr function keyreleased(".st."key".et.")<CR>".st.et."<CR>end"
exec "Snippet functionl function load()<CR>".st.et."<CR>end"
exec "Snippet functionmp function mousepressed(".st."x".et.", ".st."y".et.", ".st."button".et.")<CR>".st.et."<CR>end"
exec "Snippet functionmr function mousereleased(".st."x".et.", ".st."y".et.", ".st."button".et.")<CR>".st.et."<CR>end"
exec "Snippet functionu function update(".st."dt".et.")<CR>".st.et."<CR>end"
